package com.engineering.elink.common;

/**
 * 积分获取规则
 * @author hxjxiaojun
 *@time 2017年3月15日
 */
public enum CoinRuleEnum {
	REGISTER("注册获取积分", 1), 
	SIGN("签到获取积分", 2);

	// 成员变量
	private String name;
	private int index;

	// 构造方法
	private CoinRuleEnum(String name, int index) {
		this.name = name;
		this.index = index;
	}

	// 普通方法
	public static String getName(int index) {
		for (CoinRuleEnum c : CoinRuleEnum.values()) {
			if (c.getIndex() == index) {
				return c.name;
			}
		}
		return null;
	}

	// get set 方法
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}
	public static void main(String[] args) {
		System.out.println(CoinRuleEnum.SIGN.getIndex());
	}
}
